.row
  .col-sm-11
    h2 <%= display_name_plural %>
  .col-sm-1
    a.btn.btn-success.btn-sm href="/<%= name_plural %>/new" New
.table-responsive
  table.table.table-striped
    thead
      tr
        <%- @fields.reject{|f| f.hidden }.each do |field| -%>
        th <%= field.name.capitalize %>
        <%- end -%>
        th Actions
    tbody
      - <%= name_plural %>.each do |<%= @name %>|
        tr
          <%- @fields.reject{|f| f.hidden }.each do |field| -%>
          td = <%= @name %>.<%= field.name %><% if field.reference? %>.id<% end %>
          <%- end -%>
          td
            span
              == link_to("Show", "/<%= name_plural %>/#{<%= @name %>.id}", class: "btn btn-info btn-sm")
              == link_to("Edit", "/<%= name_plural %>/#{<%= @name %>.id}/edit", class: "btn btn-success btn-sm")
              == link_to("Delete", "/<%= name_plural %>/#{ <%= @name %>.id }?_csrf=#{csrf_token}", "data-method": "delete", "data-confirm": "Are you sure?", class: "btn btn-danger btn-sm")
